<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .b{
      width: 400px;
      height: 400px;
      background-color: pink;
    }
    .a{
      width: 200px;
      height: 200px;
      background-color: green;
    }
  </style>
</head>
<body>
  <div class="b">
    <div class="a"> 
    
    </div>
  </div>
  
  <script>
    const a = document.querySelector('.a')
    const b = document.querySelector('.b')
    b.addEventListener('click',function(e){
      alert('41111')
      
    })
    a.addEventListener('click',function(e){
      alert('22222')
      e.stopPropagation()
    })
  </script>
</body>
</html>